import { MapCursorTypes } from "../../enums";
import { MapAction, MapActionTypes } from "../actions/map.action";


export interface MapState {
    cursor: MapCursorTypes
}

export const initialMapState: MapState = {
    cursor: MapCursorTypes.DEFAULT
};

export function mapReducer(
    state: MapState = initialMapState,
    action: MapAction
): MapState {
    switch(action.type) {
        case MapActionTypes.MAP_CURSOR: {
            return {
                ...state,
                cursor: action.payload
            }
        }
        default: {
            return state;
        }
    }
}